home *** CD-ROM | disk | FTP | other *** search
/ Adobe Graphics & Publishing SDK 1996 December / Adobe Graphics & Publishing SDK 1996 December.iso / mac / PageMaker 6.5 SDK Mac / SourceCode / PageMakerClassLibrary / Queries / PTextBlock.cpp < prev    next >
C/C++ Source or Header  |  1996-08-15  |  1KB  |  59 lines

  1. /*
  2.  *--- PTextBlock.cpp ------------------------------------------------------
  3.  * Copyright (c) 1995-96 Adobe Systems Incorporated.  All rights reserved.
  4.  * Created on Sun, Oct 22, 1995 @ 4:49 PM by Paul Ferguson.
  5.  *
  6.  * Description:  For notes about this class, refer to the
  7.  * PCL documentation file PTextBlock.html
  8.  *-------------------------------------------------------------------------
  9.  */
  10. #include "stdlib.h"
  11.  
  12. #include "PTextBlock.h"
  13. #include "PReplyBuf.h"
  14.  
  15. const size_t BLOCK_SIZE = 20;        // two shorts, four longs
  16.  
  17.  
  18. PTextBlock::PTextBlock()
  19. : PListQuery()
  20. {
  21.  
  22. }
  23.  
  24. const char * PTextBlock::End()
  25. {
  26.     const char * ch = itemsStart;
  27.     
  28.     ch += listMom.Count() * BLOCK_SIZE;
  29.     
  30.     return ch;
  31. }
  32.  
  33. void PTextBlock::Scan()
  34. {
  35.     PReplyBuf reply(listMom.Current());
  36.     
  37.     reply    >> nPageNumber
  38.             >> xLeftTop
  39.             >> yLeftTop
  40.             >> xRightBottom
  41.             >> yRightBottom
  42.             >> nNumChars;
  43.     
  44.     listMom.Update(reply);
  45. }
  46.  
  47.  
  48. PTextBlock& PTextBlock::operator=(const char * ch)
  49. {
  50.     listMom = ch;
  51.     itemsStart = ch;
  52.     itemsStart += 2;
  53.     
  54.     Scan();
  55.     return *this;
  56. }
  57.  
  58. // end of PTextBlock.cpp
  59.